package com.weimob.mcloud.wechatwork.customer.service.user.service;

import com.weimob.mcloud.wechatwork.customer.service.user.base.BaseRequest;
import com.weimob.mcloud.wechatwork.customer.service.user.base.PageResponse;
import com.weimob.mcloud.wechatwork.customer.service.user.module.bo.customer.*;
import com.weimob.mcloud.wechatwork.customer.service.user.module.bo.customer.openapi.CustomerBaseInfoApi;
import com.weimob.mcloud.wechatwork.customer.service.user.module.dto.customer.*;
import com.weimob.mcloud.wechatwork.customer.service.user.module.dto.customer.openapi.CustomerDetailApi;
import com.weimob.mcloud.wechatwork.customer.service.user.module.dto.customer.openapi.CustomerQueryApi;
import com.weimob.mcloud.wechatwork.customer.service.user.module.dto.customer.openapi.ExternalUserInfoApi;
import com.weimob.mcloud.wechatwork.customer.service.user.module.dto.customer.openapi.ExternalUserInfoByWidsApi;
import com.weimob.soa.common.response.SoaResponse;

import java.util.List;

/**
 * 客户相关
 *
 * @Author yu liu  2021/10/25 16:39
 * * Description
 * * Version 1.0.0
 */
public interface CustomerExport {

    /**
     * 查询外部联系人列表
     *
     * @param externalUserInfoListDTO
     * @return
     */
    SoaResponse<CustomerPageResponse<ExternalUserListBO>, ?> queryExternalUserBaseInfoList(
            ExternalUserInfoFindDTO externalUserInfoListDTO);

    /**
     * 外部联系人导出
     *
     * @param externalUserInfoListDTO
     * @return
     */
    SoaResponse<Boolean, ?> exportExternalUserList(ExternalUserInfoFindDTO externalUserInfoListDTO);

    /**
     * 外部联系人
     *
     * @param externalUserInfoListDTO
     * @return
     */
    SoaResponse<PageResponse<ExternalUserListBO>, ?> getExternalUserByWids(
            ExternalUserInfoFindDTO externalUserInfoListDTO);


    /**
     * 根据批量wid获取员工和客户关系信息
     *
     * @param externalUserInfoByWidsDTO
     * @return
     */
    SoaResponse<List<ExternalUserRelationBO>, ?> getExternalUserRelationByWids(ExternalUserInfoByWidsDTO externalUserInfoByWidsDTO);


    /**
     * 获取单个用户的所有成员关系数据
     * 1.基础关系数据
     * 2.对应的企业标签数据
     * 3.对应的个人标签数据
     *
     * @param customerDetailDTO
     * @return
     */
    SoaResponse<PageResponse<ExternalUserRelationBO>, ?> getExternalUserRelationById(CustomerDetailDTO customerDetailDTO);


    /**
     * 根据外部联系人ID 获取详细信息
     * 1.基础信息  2.跟员工关系信息  3.标签信息   4.个人标签信息
     *
     * @param queryDTO
     * @return
     */
    SoaResponse<CustomerDetailBO, ?> queryCustomerDetail(CustomerDetailDTO queryDTO);


    /**
     * pid+suiteId级别
     * 查询企微日志
     *
     * @param dto
     * @return
     */
    SoaResponse<PageResponse<CustomerActionLogBO>, ?> findCorpActionLog(CorpActionLogFindDTO dto);

    /**
     * pid+suiteId级别
     * 写日志
     *
     * @param dto
     * @return
     */
    SoaResponse<CustomerActionLogBO, ?> addActionLog(CorpActionLogInsertDTO dto);


    /**
     * 获取用户行为日志
     *
     * @param dto
     * @return
     */
    SoaResponse<PageResponse<CustomerLogBO>, ?> findCustomerLog(CustomerLogFindDTO dto);

    /**
     * 获取行政区域
     *
     * @param divisionFindDTO
     * @return
     */
    SoaResponse<List<DivisionBO>, ?> findDivisionList(DivisionFindDTO divisionFindDTO);

    /**
     * 客户搜索变更
     *
     * @param customerSearchCallbackDTO
     * @return
     */
    SoaResponse<List<CustomerSearchCallbackBO>, ?> customerSearchCallback(CustomerSearchCallbackDTO customerSearchCallbackDTO);

    /**
     * 获取客户id
     *
     * @param customerIdGetDTO
     * @return
     */
    SoaResponse<CustomerDetailBO, ?> getCustomerBaseInfo(CustomerIdGetDTO customerIdGetDTO);

    /**
     * 批量获取客户信息
     *
     * @param customerIdGetDTO
     * @return
     */
    SoaResponse<List<CustomerDetailBO>, ?> getCustomerBaseInfoList(CustomerIdGetDTO customerIdGetDTO);

    /**
     * 根据员工获取客户
     *
     * @param customerByEmployeeDTO
     * @return
     */
    SoaResponse<PageResponse<CustomerDetailBO>, ?> getCustomerListByEmployee(CustomerByEmployeeDTO customerByEmployeeDTO);


    /**
     * 客户同步触发
     *
     * @param syncCustomerTriggerDTO
     * @return
     */
    SoaResponse<Boolean, ?> triggerSyncCustomer(SyncCustomerTriggerDTO syncCustomerTriggerDTO);

    /**
     * 更新客户备注
     *
     * @param customerRemarkDTO
     * @return
     */
    SoaResponse<Boolean, ?> updateCustomerRemark(CustomerRemarkDTO customerRemarkDTO);

    /**
     * 保客户画像 保存外部联系人CDP信息
     *
     * @param customerCDPInfoSaveDTO
     * @return
     */
    SoaResponse<Boolean, ?> saveCustomerCDPDetail(CustomerCDPInfoSaveDTO customerCDPInfoSaveDTO);

    /**
     * 手动触发同步历史外部联系人
     *
     * @param request
     * @return
     */
    SoaResponse<Boolean, ?> syncHistoryCustomer(BaseRequest request);

    /**
     * 检查手动触发同步历史外部联系人
     *
     * @param request
     * @return
     */
    SoaResponse<SyncHistoryExternaluserBO, ?> checkSyncHistoryCustomer(BaseRequest request);

    @Deprecated
    SoaResponse<PageResponse<ExternalUserExportListBO>, Void> getExportExternalUserInfo(ExternalUserInfoFindDTO externalUserInfoFindDTO);

    SoaResponse<Boolean, ?> sendCustomerSearchMsg(CustomerSearchMsgDTO request);

    /**
     * passportwid合并 客户处理
     *
     * @param dtoList
     * @return
     */
    SoaResponse<Boolean, ?> mergeCustomerWid(List<CustomerWidMergeDTO> dtoList);

    /**
     * 获取客户添加方式枚举值
     *
     * @param request
     * @return
     */
    SoaResponse<List<CustomerAddWayBO>, ?> getCustomerAddWayEnum(BaseRequest request);

    /**
     * 根据es检索查询外部联系人
     *
     * @param externalUserInfoListDTO
     * @return
     */
    SoaResponse<PageResponse<ExternalUserListBO>, ?> getExternalUserBySearch(
            ExternalUserInfoFindDTO externalUserInfoListDTO);

    SoaResponse<PageResponse<CustomerCouponsBO>, ?> getCustomerCoupons(CustomerCouponsDTO customerCDPInfoSaveDTO);

    /**
     * 根据wid查客户corpid+externaluserid
     *
     * @param externalUserInfoByWidsDTO
     * @return
     */
    SoaResponse<List<ExternalUserListBO>, ?> getCustomerByWids(ExternalUserInfoByWidsDTO externalUserInfoByWidsDTO);

    /**
     * 查询外部联系人列表-openApi
     *
     * @param externalUserInfoApiDTO
     * @return
     */
    SoaResponse<CustomerPageResponse<ExternalUserListBO>, ?> queryExternalUserList(
            ExternalUserInfoApi externalUserInfoApiDTO);


    /**
     * 根据外部联系人ID 获取详细信息 - openApi
     * 1.基础信息  2.跟员工关系信息  3.标签信息   4.个人标签信息
     *
     * @param queryDTO
     * @return
     */
    SoaResponse<CustomerDetailBO, ?> queryCustomerDetail(CustomerDetailApi queryDTO);


    /**
     * 根据批量wid获取员工和客户关系信息
     *
     * @param externalUserInfoByWidsApi
     * @return
     */
    SoaResponse<List<CustomerRelationBO>, ?> queryCustomerRelation(ExternalUserInfoByWidsApi externalUserInfoByWidsApi);


    /**
     * 判断是否是好友
     *
     * @param customerDetailDTO
     * @return
     */
    SoaResponse<Boolean, ?> checkIsFriended(CustomerDetailDTO customerDetailDTO);

    /**
     * 查询企微客户基础信息 通过wid或者externalUserId
     *
     * @param queryDTO 入参对象
     * @return SoaResponse<CustomerBaseInfoBO, ?> 返回对象
     */
    SoaResponse<CustomerBaseInfoApi, ?> queryCustomerBaseInfoForApi(CustomerQueryApi queryDTO);

}
